	.file	"bf.c"
	.text
.globl bf_stream_new
	.type	bf_stream_new, @function
bf_stream_new:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	subl	$4, %esp
	subl	$12, %esp
	pushl	$20
	call	malloc
	addl	$16, %esp
	movl	%eax, -8(%ebp)
	movl	-8(%ebp), %ebx
	subl	$12, %esp
	pushl	$4096
	call	malloc
	addl	$16, %esp
	movl	%eax, 8(%ebx)
	movl	-8(%ebp), %edx
	movl	8(%ebp), %eax
	movl	%eax, 12(%edx)
	movl	-8(%ebp), %edx
	movl	-8(%ebp), %eax
	movl	8(%eax), %eax
	movl	%eax, 4(%edx)
	movl	-8(%ebp), %eax
	movl	$0, (%eax)
	movl	-8(%ebp), %eax
	movl	-4(%ebp), %ebx
	leave
	ret
	.size	bf_stream_new, .-bf_stream_new
.globl bf_open
	.type	bf_open, @function
bf_open:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	subl	$4, %esp
	pushl	$420
	pushl	12(%ebp)
	pushl	8(%ebp)
	call	open
	addl	$16, %esp
	movl	%eax, -4(%ebp)
	cmpl	$-1, -4(%ebp)
	jne	.L10
	movl	$0, -8(%ebp)
	jmp	.L9
.L10:
	subl	$12, %esp
	pushl	-4(%ebp)
	call	bf_stream_new
	addl	$16, %esp
	movl	%eax, -8(%ebp)
.L9:
	movl	-8(%ebp), %eax
	leave
	ret
	.size	bf_open, .-bf_open
.globl bf_close
	.type	bf_close, @function
bf_close:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	subl	$12, %esp
	pushl	8(%ebp)
	call	bf_flush
	addl	$16, %esp
	subl	$12, %esp
	movl	8(%ebp), %eax
	pushl	12(%eax)
	call	close
	addl	$16, %esp
	movl	%eax, -4(%ebp)
	subl	$12, %esp
	pushl	8(%ebp)
	call	free
	addl	$16, %esp
	movl	-4(%ebp), %eax
	leave
	ret
	.size	bf_close, .-bf_close
	.section	.rodata
.LC0:
	.string	"bf_fillbuf"
	.text
.globl bf_fillbuff
	.type	bf_fillbuff, @function
bf_fillbuff:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	subl	$4, %esp
	movl	8(%ebp), %ebx
	subl	$4, %esp
	pushl	$4096
	movl	8(%ebp), %eax
	pushl	8(%eax)
	movl	8(%ebp), %eax
	pushl	12(%eax)
	call	read
	addl	$16, %esp
	movl	%eax, (%ebx)
	movl	8(%ebp), %eax
	cmpl	$-1, (%eax)
	jne	.L13
	subl	$12, %esp
	pushl	$.LC0
	call	perror
	addl	$16, %esp
	subl	$12, %esp
	pushl	$1
	call	exit
.L13:
	movl	8(%ebp), %edx
	movl	8(%ebp), %eax
	movl	8(%eax), %eax
	movl	%eax, 4(%edx)
	movl	8(%ebp), %edx
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	sall	$3, %eax
	movl	%eax, (%edx)
	movl	-4(%ebp), %ebx
	leave
	ret
	.size	bf_fillbuff, .-bf_fillbuff
	.section	.rodata
	.align 32
.LC1:
	.string	"flushing bf. count : %d, data %s\n"
.LC2:
	.string	"bf_flush"
	.text
.globl bf_flush
	.type	bf_flush, @function
bf_flush:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$24, %esp
	movl	$0, -4(%ebp)
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	andl	$7, %eax
	testl	%eax, %eax
	je	.L15
	movl	8(%ebp), %eax
	pushl	8(%eax)
	movl	8(%ebp), %eax
	pushl	(%eax)
	pushl	$.LC1
	pushl	stderr
	call	fprintf
	addl	$16, %esp
.L15:
	movl	8(%ebp), %eax
	movl	%eax, -12(%ebp)
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	movl	%eax, -16(%ebp)
	cmpl	$0, -16(%ebp)
	jns	.L16
	addl	$7, -16(%ebp)
.L16:
	movl	-16(%ebp), %eax
	sarl	$3, %eax
	movl	-12(%ebp), %edx
	movl	%eax, (%edx)
.L17:
	movl	8(%ebp), %eax
	cmpl	$0, (%eax)
	jne	.L19
	jmp	.L18
.L19:
	subl	$4, %esp
	movl	8(%ebp), %eax
	pushl	(%eax)
	movl	8(%ebp), %eax
	pushl	8(%eax)
	movl	8(%ebp), %eax
	pushl	12(%eax)
	call	write
	addl	$16, %esp
	movl	%eax, -4(%ebp)
	cmpl	$-1, -4(%ebp)
	jne	.L20
	subl	$12, %esp
	pushl	$.LC2
	call	perror
	addl	$16, %esp
	movl	$-1, -8(%ebp)
	jmp	.L14
.L20:
	movl	8(%ebp), %ecx
	movl	8(%ebp), %eax
	movl	-4(%ebp), %edx
	movl	(%eax), %eax
	subl	%edx, %eax
	movl	%eax, (%ecx)
	jmp	.L17
.L18:
	movl	-4(%ebp), %eax
	movl	%eax, -8(%ebp)
.L14:
	movl	-8(%ebp), %eax
	leave
	ret
	.size	bf_flush, .-bf_flush
.globl bf_putbit
	.type	bf_putbit, @function
bf_putbit:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	subl	$20, %esp
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	movl	%eax, -16(%ebp)
	cmpl	$0, -16(%ebp)
	jns	.L22
	addl	$7, -16(%ebp)
.L22:
	movl	-16(%ebp), %eax
	sarl	$3, %eax
	movl	%eax, -8(%ebp)
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	movl	%eax, -20(%ebp)
	movl	-20(%ebp), %eax
	movl	%eax, -24(%ebp)
	cmpl	$0, -24(%ebp)
	jns	.L23
	addl	$7, -24(%ebp)
.L23:
	movl	-24(%ebp), %eax
	sarl	$3, %eax
	sall	$3, %eax
	movl	-20(%ebp), %edx
	subl	%eax, %edx
	movl	$7, %eax
	subl	%edx, %eax
	movl	%eax, -12(%ebp)
	cmpl	$0, 12(%ebp)
	je	.L24
	movl	8(%ebp), %edx
	movl	-8(%ebp), %eax
	movl	8(%edx), %ebx
	addl	%eax, %ebx
	movl	8(%ebp), %edx
	movl	-8(%ebp), %eax
	movl	8(%edx), %edx
	addl	%eax, %edx
	movl	$1, %eax
	movb	-12(%ebp), %cl
	sall	%cl, %eax
	orb	(%edx), %al
	movb	%al, (%ebx)
	jmp	.L25
.L24:
	movl	8(%ebp), %edx
	movl	-8(%ebp), %eax
	movl	8(%edx), %ebx
	addl	%eax, %ebx
	movl	8(%ebp), %edx
	movl	-8(%ebp), %eax
	movl	8(%edx), %edx
	addl	%eax, %edx
	movl	$1, %eax
	movb	-12(%ebp), %cl
	sall	%cl, %eax
	notl	%eax
	andb	(%edx), %al
	movb	%al, (%ebx)
.L25:
	movl	8(%ebp), %eax
	incl	(%eax)
	cmpl	$32768, (%eax)
	jne	.L26
	subl	$12, %esp
	pushl	8(%ebp)
	call	bf_flush
	addl	$16, %esp
.L26:
	movl	12(%ebp), %eax
	movl	-4(%ebp), %ebx
	leave
	ret
	.size	bf_putbit, .-bf_putbit
.globl bf_getbit
	.type	bf_getbit, @function
bf_getbit:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$24, %esp
	movl	8(%ebp), %eax
	cmpl	$0, (%eax)
	jne	.L28
	subl	$12, %esp
	pushl	8(%ebp)
	call	bf_fillbuff
	addl	$16, %esp
.L28:
	movl	8(%ebp), %eax
	cmpl	$0, (%eax)
	jne	.L29
	movl	$-1, -8(%ebp)
	jmp	.L27
.L29:
	movl	8(%ebp), %eax
	decl	(%eax)
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	movl	%eax, -12(%ebp)
	movl	-12(%ebp), %eax
	movl	%eax, -16(%ebp)
	cmpl	$0, -16(%ebp)
	jns	.L30
	addl	$7, -16(%ebp)
.L30:
	movl	-16(%ebp), %eax
	sarl	$3, %eax
	sall	$3, %eax
	movl	-12(%ebp), %edx
	subl	%eax, %edx
	movl	%edx, %eax
	movl	%eax, -4(%ebp)
	cmpl	$0, -4(%ebp)
	je	.L31
	movl	8(%ebp), %eax
	movl	4(%eax), %eax
	movsbl	(%eax),%eax
	movl	%eax, -20(%ebp)
	movb	-4(%ebp), %cl
	sarl	%cl, -20(%ebp)
	andl	$1, -20(%ebp)
	jmp	.L32
.L31:
	movl	8(%ebp), %edx
	movl	4(%edx), %eax
	movsbl	(%eax),%eax
	movl	%eax, -20(%ebp)
	movb	-4(%ebp), %cl
	sarl	%cl, -20(%ebp)
	andl	$1, -20(%ebp)
	incl	4(%edx)
.L32:
	movl	-20(%ebp), %eax
	movl	%eax, -8(%ebp)
.L27:
	movl	-8(%ebp), %eax
	leave
	ret
	.size	bf_getbit, .-bf_getbit
.globl bf_putchar
	.type	bf_putchar, @function
bf_putchar:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	movl	$7, -4(%ebp)
.L34:
	cmpl	$0, -4(%ebp)
	jns	.L37
	jmp	.L35
.L37:
	subl	$8, %esp
	movb	-4(%ebp), %cl
	movl	12(%ebp), %eax
	sarl	%cl, %eax
	andl	$1, %eax
	pushl	%eax
	pushl	8(%ebp)
	call	bf_putbit
	addl	$16, %esp
	leal	-4(%ebp), %eax
	decl	(%eax)
	jmp	.L34
.L35:
	movl	12(%ebp), %eax
	leave
	ret
	.size	bf_putchar, .-bf_putchar
.globl bf_getchar
	.type	bf_getchar, @function
bf_getchar:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$40, %esp
	movl	$0, -12(%ebp)
	movl	$7, -4(%ebp)
.L39:
	cmpl	$0, -4(%ebp)
	jns	.L42
	jmp	.L40
.L42:
	subl	$12, %esp
	pushl	8(%ebp)
	call	bf_getbit
	addl	$16, %esp
	movl	%eax, -8(%ebp)
	cmpl	$-1, -8(%ebp)
	jne	.L43
	movl	$-1, -20(%ebp)
	jmp	.L38
.L43:
	fildl	-12(%ebp)
	fstpl	-32(%ebp)
	fildl	-8(%ebp)
	fstpl	-40(%ebp)
	fildl	-4(%ebp)
	leal	-8(%esp), %esp
	fstpl	(%esp)
	movl	$0, %eax
	movl	$1073741824, %edx
	pushl	%edx
	pushl	%eax
	call	pow
	addl	$16, %esp
	fmull	-40(%ebp)
	faddl	-32(%ebp)
	fnstcw	-14(%ebp)
	movw	-14(%ebp), %ax
	movb	$12, %ah
	movw	%ax, -16(%ebp)
	fldcw	-16(%ebp)
	fistpl	-12(%ebp)
	fldcw	-14(%ebp)
	leal	-4(%ebp), %eax
	decl	(%eax)
	jmp	.L39
.L40:
	movl	-12(%ebp), %eax
	movl	%eax, -20(%ebp)
.L38:
	movl	-20(%ebp), %eax
	leave
	ret
	.size	bf_getchar, .-bf_getchar
.globl bf_isaligned
	.type	bf_isaligned, @function
bf_isaligned:
	pushl	%ebp
	movl	%esp, %ebp
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	andl	$7, %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	leave
	ret
	.size	bf_isaligned, .-bf_isaligned
.globl bf_align
	.type	bf_align, @function
bf_align:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$24, %esp
	subl	$12, %esp
	pushl	8(%ebp)
	call	bf_isaligned
	addl	$16, %esp
	testl	%eax, %eax
	je	.L46
	movl	$0, -8(%ebp)
	jmp	.L45
.L46:
	movl	8(%ebp), %eax
	movl	(%eax), %eax
	movl	%eax, -12(%ebp)
	movl	-12(%ebp), %eax
	movl	%eax, -16(%ebp)
	cmpl	$0, -16(%ebp)
	jns	.L47
	addl	$7, -16(%ebp)
.L47:
	movl	-16(%ebp), %eax
	sarl	$3, %eax
	sall	$3, %eax
	movl	-12(%ebp), %edx
	subl	%eax, %edx
	movl	$8, %eax
	subl	%edx, %eax
	movl	%eax, -4(%ebp)
.L48:
	cmpl	$0, -4(%ebp)
	jg	.L51
	jmp	.L49
.L51:
	subl	$8, %esp
	pushl	$0
	pushl	8(%ebp)
	call	bf_putbit
	addl	$16, %esp
	leal	-4(%ebp), %eax
	decl	(%eax)
	jmp	.L48
.L49:
	movl	$0, -8(%ebp)
.L45:
	movl	-8(%ebp), %eax
	leave
	ret
	.size	bf_align, .-bf_align
	.section	.note.GNU-stack,"",@progbits
	.ident	"GCC: (GNU) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)"
